/*
 * @(#)MaintMtmDocumentRelationshipForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.dms.bean.MtmDocumentRelationship;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.setup.web.AbstractActionPermissionForm;

/**
  MaintMtmDocumentRelationshipForm.java
  This class is the for web form purpose.
  @author      Rollo Chan
  @company     DCIVision Limited
  @creation date   02/01/2004
  @version     $Revision: 1.10 $
 */

public class MaintMtmDocumentRelationshipForm extends AbstractActionPermissionForm {

  public static final String REVISION = "$Revision: 1.10 $";

  private String documentID = null;
  private String relatedDocumentID = null;
  private String relationshipType = null;
  private String description = null;

  //used for DMS module
  private String parentID = null;
  private String rootID = null;
  private String curFunctionCode = null;
  private String documentName = null;
  private String locationPath = null;
  private String parentModule = null;
  
  /** used for return button to find the navigation */
  private String directURL=null;
  
  private String directPage=null;
  
  private String isMyFavorite=null;
  
  private String inheritanceFlag = null;  
  private String objectID = null;  
  private String objectType = null;   
  private String permission = null; 
  private String setPermission = null;      

  public MaintMtmDocumentRelationshipForm() {
    super();
  }

  public String getDocumentID() {
    return (this.documentID);
  }

  public void setDocumentID(String documentID) {
    this.documentID = documentID;
  }

  public String getRelatedDocumentID() {
    return (this.relatedDocumentID);
  }

  public void setRelatedDocumentID(String relatedDocumentID) {
    this.relatedDocumentID = relatedDocumentID;
  }

  public String getRelationshipType() {
    return (this.relationshipType);
  }

  public void setRelationshipType(String relationshipType) {
    this.relationshipType = relationshipType;
  }

  public String getDescription() {
    return (this.description);
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String getParentID() {
    return (this.parentID);
  }

  public void setParentID(String parentID) {
    this.parentID = parentID;
  }

  public String getRootID() {
    return (this.rootID);
  }

  public void setRootID(String rootID) {
    this.rootID = rootID;
  }

  public void setCurFunctionCode(String curFunctionCode) {
    this.curFunctionCode = curFunctionCode;
  }

  public String getCurFunctionCode() {
    return curFunctionCode;
  }

  public String getDocumentName() {
    return(this.documentName);
  }

  public void setDocumentName(String documentName) {
    this.documentName = documentName;
  }

  public String getLocationPath(){
    return locationPath;
  }

  public void setLocationPath(String locationPath){
    this.locationPath = locationPath;
  }

  public String getParentModule(){
    return this.parentModule;
  }

  public void setParentModule(String parentModule){
    this.parentModule= parentModule;
  }
  
  public String getDirectURL(){
    return this.directURL; 
  }
  
  public void setDirectURL(String directURL){
    this.directURL=directURL; 
  }
    
  public String getDirectPage(){
    return this.directPage; 
  }
  
  public void setDirectPage(String directPage){
    this.directPage=directPage; 
  }
    
  public String getIsMyFavorite(){
    return this.isMyFavorite; 
  }
  
  public void setIsMyFavorite(String isMyFavorite){
    this.isMyFavorite=isMyFavorite; 
  }

  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setDocumentID(null);
    this.setRelatedDocumentID(null);
    this.setRelationshipType(null);
    this.setDescription(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    MtmDocumentRelationship tmpMtmDocumentRelationship = new MtmDocumentRelationship();
    tmpMtmDocumentRelationship.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpMtmDocumentRelationship.setDocumentID(TextUtility.parseIntegerObj(this.getDocumentID()));
    tmpMtmDocumentRelationship.setRelatedDocumentID(TextUtility.parseIntegerObj(this.getRelatedDocumentID()));
    tmpMtmDocumentRelationship.setRelationshipType(this.getRelationshipType());
    tmpMtmDocumentRelationship.setDescription(this.getDescription());
    tmpMtmDocumentRelationship.setDocumentName(this.getDocumentName());
    tmpMtmDocumentRelationship.setParentID(TextUtility.parseIntegerObj(this.getParentID()));
    tmpMtmDocumentRelationship.setRootID(TextUtility.parseIntegerObj(this.getRootID()));
    tmpMtmDocumentRelationship.setRecordStatus(this.getRecordStatus());
    tmpMtmDocumentRelationship.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpMtmDocumentRelationship.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpMtmDocumentRelationship.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpMtmDocumentRelationship.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpMtmDocumentRelationship.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpMtmDocumentRelationship;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    MtmDocumentRelationship tmpMtmDocumentRelationship = (MtmDocumentRelationship)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpMtmDocumentRelationship.getID()));
    this.setDocumentID(TextUtility.formatIntegerObj(tmpMtmDocumentRelationship.getDocumentID()));
    this.setRelatedDocumentID(TextUtility.formatIntegerObj(tmpMtmDocumentRelationship.getRelatedDocumentID()));
    this.setRelationshipType(tmpMtmDocumentRelationship.getRelationshipType());
    this.setDescription(tmpMtmDocumentRelationship.getDescription());
    this.setRecordStatus(tmpMtmDocumentRelationship.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpMtmDocumentRelationship.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpMtmDocumentRelationship.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpMtmDocumentRelationship.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpMtmDocumentRelationship.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpMtmDocumentRelationship.getUpdateDate()));
  }
  
  public String getInheritanceFlag() {
    return(this.inheritanceFlag);
  }

  public void setInheritanceFlag(String inheritanceFlag) {
    this.inheritanceFlag = inheritanceFlag;
  }
  
  public String getObjectID() {
    return(this.objectID);
  }

  public void setObjectID(String objectID) {
    this.objectID = objectID;
  }

  public String getObjectType() {
    return(this.objectType);
  }

  public void setObjectType(String objectType) {
    this.objectType = objectType;
  }
  
  public String getPermission() {
    return(this.permission);
  }

  public void setPermission(String permission) {
    this.permission = permission;
  }  
  
  public String getSetPermission() {
    return(this.setPermission);
  }

  public void setSetPermission(String setPermission) {
    this.setPermission = setPermission;
  }  
    
  
}